package middleware

import (
	"net/http"
)

const (
	metadataHeaderPrefix = "Grpc-Metadata-"
)

type MetadataMiddleware struct {
}

func NewMetadataMiddleware() *MetadataMiddleware {
	return &MetadataMiddleware{}
}

func (m *MetadataMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		// 踩坑：r.Header.Get("User-Agent") 这里传到 rpc 服务端会变为 [grpc-go/1.65.0]

		//myClaims := r.Header.Get("MyClaims")

		next(w, r)
	}
}
